POV-Ray : Newsgroups : povray.advanced-users : Problem concerning the use of array indices inside functions : Re: Problem concerning the use of array indices inside functions Server Time
29 Jul 2024 06:26:42 EDT (-0400)
  Re: Problem concerning the use of array indices inside functions  
From: Jaap Frank
Date: 2 May 2003 13:50:57
Message: <3eb2b001$1@news.povray.org>
"Mark Weyer" <wey### [at] informatikuni-freiburgde> wrote in message
news:3EB### [at] informatikuni-freiburgde...
> > ultimately POV-ray needs something like
> >
> >    #declare F = function(x)
> >    { Cube[int((x-X0)/StepX)]  }
>
> I might get killed for proposing something so inefficient, but:
> (I only treat one-dimensional array, the rest (including optimization
> correction of errors, introduction of interpolation,...) I leave to you)
>
> #declare F = function(x)
> {
>    #local I=1;
>    #while (I<Max)
>
>      select (x-X0-I*StepX, Cube[I-1],
>
>      #local I=I+1;
>    #end
>
>    Cube[Max-1]
>
>    #local I=1;
>    #while (I<Max)
>
>      )
>
>      #local I=I+1:
>    #end
> }

Although it will need about 40 selects in a row, it may be a solution.
I will need probably about 25 of them, so I hope it is not to much
for POV-ray.

Thank you for this possibility!

Jaap Frank


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.